// $URL: http://mingw-lib.googlecode.com/svn/trunk/working/avcodec_to_widget_10/input/t_box_input_youtube.h $
// $Rev: 344 $
// $Author: akio.miyoshi $
// $Date:: 2010-08-02 12:42:15 +0000#$

#ifndef T_BOX_INPUT_YOUTUBE_H
#define T_BOX_INPUT_YOUTUBE_H

#include "t_box_input.h"
#include "core/nbr.h"

class T_Box_Input_Youtube : public T_Box_Input
{
    Q_OBJECT
public:
    static const int c_buffer_size = 4096;
    ////quint8 *m_buffer;
    T_RecursiveAtomic m_mutex;
    bool m_is_valid;
    T_Box_Input_Youtube(const QString &a_video_id, int a_fmt);
    ~T_Box_Input_Youtube();
    virtual bool isValid();
    virtual void close();
protected:
    virtual qint64 size();
    virtual qint64 pos();
    virtual bool seek(qint64 offset);
    virtual QByteArray wait_read(qint64 a_max_size);
    virtual int bufferSize();
    class T_Box_Input_YoutubePrivate *d_ptr;
    Q_DECLARE_PRIVATE(T_Box_Input_Youtube)
    friend class T_Box_Input_Youtube_Thread;
};

#endif // T_BOX_INPUT_YOUTUBE_H
